import { post, get } from './axios'

// 获取用户列表
export function getUserList() {
  return get('/admin/manage/user/list')
}

// 删除用户
export function deleteUser(id) {
  return get('admin/manage/user/delete/' + id)
}

// 搜索用户
export function searchUser(id) {
  return get('admin/manage/user/search', {
    params: {
      _id: id
    }
  })
}

// 获取用户基本信息
export class GetUserInfo {
  constructor(data) {
    this.id = data._id
    this.nickname = data.basicInfo.nickname
    this.phone = data.basicInfo.phone || ''
    this.email = data.basicInfo.phone || ''
  }
}